﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package tool {
    import Display.DialogUI.*;
    import Classes.*;
    import com.zynga.skelly.render.*;
    import com.zynga.skelly.animation.*;
    import Display.*;

    public class OffsetEditor implements IAnimated {

        private static var _active:Boolean = false;
        private static var _instance:OffsetEditor;
        private static var _selected:GameObject;
        public static var captureMode:Boolean = false;

        private var m_dialog:OffsetEditorDialog;
        public var visible:Boolean = false;

        public function OffsetEditor(){
            this.m_dialog = new OffsetEditorDialog();
            super();
            this.init();
        }
        public static function get instance():OffsetEditor{
            if (!_instance){
                _instance = new (OffsetEditor)();
            };
            return (_instance);
        }
        public static function get active():Boolean{
            return (_active);
        }
        public static function set selected(_arg1:GameObject):void{
            instance.m_dialog.displayOffsets(_arg1, true);
            _selected = _arg1;
        }
        public static function set active(_arg1:Boolean):void{
            _active = _arg1;
            if (_arg1){
                instance.showDialog();
            } else {
                if (_instance){
                    instance.hideDialog();
                };
            };
        }

        public function init():void{
        }
        public function animate(_arg1:uint):Boolean{
            this.m_dialog.checkObject();
            return (this.visible);
        }
        public function showDialog():void{
            this.visible = true;
            UI.displayPopup(this.m_dialog, false);
            RenderManager.addAnimationByFPS(12, this);
        }
        private function hideDialog():void{
            this.m_dialog.hide();
            this.visible = false;
            _selected = null;
        }
        public function consider(_arg1:GameObject):void{
            if (((!(_selected)) || (captureMode))){
                this.m_dialog.displayOffsets(_arg1, captureMode);
            };
        }

    }
}//package tool 
